home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PASCALL / TEMPJUNK / FERN.PAS < prev    next >
Pascal/Delphi Source File  |  1992-10-05  |  718b  |  49 lines

  1. program gottt;
  2. uses
  3.      crt;
  4. type
  5.      stevex=1..80;
  6.      stevey=1..24;
  7. var
  8.      x1,x2:stevex;
  9.      y1,y2:stevey;
  10.      sx, sy, y, i:integer;
  11.  
  12.  
  13. procedure update;
  14. begin
  15.      x1:=x1+sx;
  16.      y1:=y1+sy;
  17.      gotoxy(x1,y1);
  18.      write('*');
  19.      gotoxy(x2,y2);
  20.      write(' ');
  21. end;
  22.  
  23.  
  24. procedure go;
  25. begin
  26.      x2:=x1;
  27.      y2:=y1;
  28.      if x1+sx>80 then sx:=(sx*(-1));
  29.      if x1+sx<2 then sx:=(sx*(-1));
  30.      if y1+sy>24 then sy:=(sy*(-1));
  31.      if y1+sy<2 then sy:=(sy*(-1));
  32.      update;
  33. end;
  34.  
  35.  
  36. begin
  37.      clrscr;
  38.      sx:=1;
  39.      sy:=1;
  40.      x1:=1;
  41.      y1:=1;
  42.      x2:=1;
  43.      y2:=1;
  44.      for y:=1 to 1000 do
  45.      begin
  46.           go;
  47.           DELAY(25);
  48.      end;
  49. end.